package com.qls.mt.api;

import com.qls.core.ali.order.bookrq.request.BookRq;
import com.qls.core.ali.order.cancelrq.CancelRq;
import com.qls.core.ali.order.validaterq.request.ValidateRq;
import com.qls.core.dto.InitBody;
import com.qls.core.dto.PushHotelBody;
import com.qls.core.dto.PushRatesBody;
import com.qls.core.dto.PushRpBody;
import com.qls.core.entity.HtHotel;
import com.qls.core.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author doyoung
 */
@FeignClient("mt-service")
public interface MtRemoteService {

    /**
     * 拉取酒店
     *
     * @param initBody InitBody
     * @return R
     */
    @PostMapping(value = "mt/hotel/detail")
    R hotelDetail(@RequestBody InitBody initBody);

    /**
     * 拉取酒店 房型 售卖房型 价态信息
     *
     * @param pushHotelBody PushHotelBody
     * @return R
     */
    @PostMapping(value = "mt/hotel/hotel_all")
    R hotelAll(@RequestBody PushHotelBody pushHotelBody);

    /**
     * 拉取酒店列表
     *
     * @param params Map<String, Object>
     * @return R
     */
    @GetMapping(value = "mt/hotel/pull_all")
    R pullAll(@RequestParam Map<String, Object> params);

    /**
     * 接受美团房态变化和价格信息
     *
     * @param pushRatesBody
     * @return
     */
    @RequestMapping(value = "mt/hotel/CALLBACK_RATES", method = RequestMethod.POST)
    R callbackRates(@RequestBody PushRatesBody pushRatesBody);

    /**
     * 接受美团酒店变化信息
     *
     * @param htHotel
     * @return
     */
    @RequestMapping(value = "mt/hotel/CALLBACK_HOTEL", method = RequestMethod.POST)
    R callbackHotel(@RequestBody HtHotel htHotel);

    /**
     * 接受美团售卖房型信息
     *
     * @param pushRpBody
     * @return
     */
    @RequestMapping(value = "mt/hotel/CALLBACK_RP", method = RequestMethod.POST)
    R callbackRp(@RequestBody PushRpBody pushRpBody);

    /**
     * 下单前校验(美团）
     *
     * @param validateRq ValidateRq
     * @return
     */
    @PostMapping(value = "mt/order/validate")
    R validate(@RequestBody ValidateRq validateRq);

    /**
     * 预约下单(美团）
     *
     * @param bookRq BookRq
     * @return
     */
    @PostMapping(value = "mt/order/book")
    R book(@RequestBody BookRq bookRq);

    /**
     * 取消下单(美团）
     *
     * @param cancelRq CancelRq
     * @return
     */
    @PostMapping(value = "mt/order/cancel")
    R cancel(@RequestBody CancelRq cancelRq);

    /**
     * 订单状态变更通知
     *
     * @param validateRq
     * @return
     */
    @PostMapping(value = "mt/order/callback_order")
    R callback(@RequestBody ValidateRq validateRq);

}
